package com.bjdd.jdy.ui.bindCard;

import com.bjdd.jdy.base.BaseResult;
import com.bjdd.jdy.entity.BankBean;
import com.bjdd.jdy.util.Api;
import com.bjdd.jdy.util.RxSchedulers;

import java.util.List;

import rx.Observable;

/**
 * Created by Administrator on 2017/5/11.
 */

public class BindCardModel implements BindCardContract.Model {
    @Override
    public Observable<BaseResult<List<BankBean>>> getBank(String token) {
        return Api.getInstance().service
                .getBanks(token)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<String>> bindCard(String token, String carrierId, String bankcard, String realname, String bankId) {
        return Api.getInstance().service
                .bindBankCard(token,carrierId,bankcard,realname,bankId)
                .compose(RxSchedulers.io_main());
    }
}
